<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <link rel="shortcut icon" href="favicon.ico">
    <link href="/state/css/bootstrap.min14ed.css" rel="stylesheet">
    <link href="/state/css/style.min.css" rel="stylesheet">
    <link href="/state/css/plugins/switchery/switchery.css" rel="stylesheet">
    <!-- 加载编辑器的容器 -->

</head>

<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form method="post" id="form1" name="form1" class="form-horizontal" action="/adminchy/User/editUser">
                        
                        <input hidden="true" name="user_id" value="{$user.user_id}">
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">会员昵称:</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" placeholder="必填" id="username" name="user_name" value="{$user.user_name}">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">手机号:</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" placeholder="必填" id="mobile_phone" name="user_phone" value="{$user.user_phone}">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">用户金币数:</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" placeholder="必填" id="user_money" name="user_gold" value="{$user.user_gold}">
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">登录密码:</label>
                            <div class="col-sm-6">
                                <input type="text" class="form-control" placeholder="不填则不修改" id="user_password" name="user_password">
                            </div>
                        </div>
                        <div class="hr-line-dashed"></div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">支付密码:</label>

                            <div class="col-sm-6">
                                <input type="text" class="form-control" placeholder="不填则不修改" id="user_pmtpwd" name="user_pmtpwd">
                            </div>
                        </div>

                        <div class="hr-line-dashed"></div>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <button class="btn btn-primary" type="submit">确认修改:</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="/state/js/jquery.min.js"></script>
<script src="/state/js/jquery.form.js"></script>
<script src="/state/js/plugins/layer/layer.min.js"></script>
<script src="/state/js/common.js"></script>
<script>
    $(function(){
        $('#form1').ajaxForm({
            beforeSubmit: checkFun,
            success: complete,
            dataType: 'json'
        });
        function checkFun(){

            if($('#username').val() == ''){
                layer.tips('会员姓名不能为空', '#username',{
                    tips: [2, '#d9534f']
                });
                $('#username').focus();
                return false;
            }

            if($('#user_phone').val() == ''){
                layer.tips('手机号不能为空', '#user_phone',{
                    tips: [2, '#d9534f']
                });
                $('#user_phone').focus();
                return false;
            }
        }
        function complete(data){
            if(data.status == 0){
                layer.msg(data.message, {icon: 6,time:1000},function(){
                    window.parent.location.reload();
                 });
            }else{
                layer.msg(data.message, {icon: 5,time:1000},function(){
                    window.parent.location.reload();
                 });
            }
             
        }
    })
</script>
</body>
</html>
